﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PaceR.Core.Interfaces.PatternMatching;
using PaceR.Core.PatternMatching;

namespace PaceR.Core.Factories
{
    public sealed class SimplePatternMatchFactory : IPatternMatchFactory
    {
        #region IPatternMatchFactory Members

        public IPatternMatcher<T> GetPatternMatcher<T>(T pattern)
        {
            if (typeof(T) == typeof(string))
                return new RegexPatternMatcher(pattern.ToString()) as IPatternMatcher<T>;
            else
                return new GenericPatternMatcher<T>(pattern);
        }

        #endregion
    }
}
